// RasterKey.h
//
#ifndef RASTERKEY_H
#define RASTERKEY_H

#include "GUIElement.h"
#include "../Color.h"

#include <QGraphicsSimpleTextItem>
#include <QVector>

namespace IDS {
namespace IDEAS {
namespace OpenGLView {
namespace GUIElements {

class RasterKey : public GUIElement
{
protected:
	QRectF rect;
	QString title;

	QVector<QGraphicsSimpleTextItem> textItems;

	void adjustRect();

	virtual QVariant itemChange ( GraphicsItemChange change, const QVariant & value );


public:
	RasterKey(int x, int y);
	virtual ~RasterKey();

	QRectF boundingRect() const;
	void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *);	
	
	void setTitle( const std::string &title);
	void setValues( const std::vector< std::pair<double,double> > &values);
	void setColors( const std::vector< IDS::OpenGL::Color > &colors);
};

}}}}


#endif